package com.zhanghaijun.web.controller.api;

import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiOperation;
import com.zhanghaijun.dto.JsonResultDto;
import com.zhanghaijun.web.controller.api.response.TestResponseBean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by zhanghaijun on 15/8/24.
 */
@ApiModel("测试api")
@Controller
public class TestController {


    @ApiOperation(value = "通过uid、age、用户名获取用户信息",httpMethod = "GET")
    @RequestMapping(value = "/api/test/{uid}/{age}/{userName}",method = RequestMethod.GET)
    @ResponseBody
    public JsonResultDto getListData(@PathVariable("uid") int uid,
                                     @PathVariable("age") int age,@PathVariable("userName") String userName){
        TestResponseBean testResponseBean = new TestResponseBean();
        testResponseBean.setUid(uid);
        testResponseBean.setAge(age);
        testResponseBean.setUserName(userName);
        return new JsonResultDto(true,101,testResponseBean);
    }


}
